import Vue from 'vue'
import App from './App.vue'
import router from './router'

// 引入阿里图标库
import '../public/iconfont/iconfont.css'
import '../public/iconfont/iconfont.js'
Vue.config.productionTip = false

// 导入vue-awesome-swiper 滑动特效插件 挂载轮播图
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
Vue.use(VueAwesomeSwiper);
// 视频播放器
import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css'

import axios from 'axios'
Vue.prototype.axios = axios;

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
// 自定义弹窗
import Toast from './components/toast/toast.js'
// 将组件注册到vue的原型链,这样就可以在所有的VUE的实例里面使用this.$toast()
Vue.prototype.$toast=Toast   //注册全局组件

axios.interceptors.request.use(config => {
  // 在请求头中添加token
  config.headers.Authorization = window.localStorage.getItem("user")
  return config
})

// 响应拦截器
// 响应拦截器

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
